<%-- 
    Document   : EditProfile
    Created on : Mar 27, 2011, 10:55:45 PM
    Author     : eisa
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>User Profile</title>
    </head>
    
        <body>
        <div id="main_container">
        <jsp:include page="Banner.html" />
        <jsp:include page="menuTab.jsp" />
        <jsp:include page="/AllCategory" />
        
        <div class="center_content">

   	<div class="center_title_bar">Sign Up</div>

    	<div class="prod_box_big">
        	<div class="top_prod_box_big"></div>
            <div class="center_prod_box_big">

              	<div class="contact_form">
                    <form action="SignupBeans.jsp" method="Post" id="changeForm"  >
                    <div id="divName"  class="form_row">
                    <label class="contact"><strong>Name:</strong></label>
                    <input  id="textName" readonly name="name" type="text" class="contact_input" value="${LOGIN_USER.customerName}"/>
                    <div style="float: right" >
                    <a href="javascript:openToEdit('textName')">Edit</a>
                    </div>
                    </div>

                    <div  id="divEmail" class="form_row">
                    <label class="contact"><strong>Email:</strong></label>
                    <input id="textEmail" readonly type="text" name="email" class="contact_input" value="${LOGIN_USER.customerEmail}" />
                    <div style="float: right" >
                    <a href="javascript:openToEdit('textEmail')">Edit</a>
                    </div>
                    </div>

                    <div class="form_row">
                    <label class="contact"><strong>Phone:</strong></label>
                    <input id="textPhone" type="text" readonly name="phone" class="contact_input" value="${LOGIN_USER.phoneNumber}" />
                    <div style="float: right" >
                    <a href="javascript:openToEdit('textPhone')">Edit</a>
                    </div>

                    </div >

                    <div class="form_row">
                    <label class="contact"><strong>credit:</strong></label>
                    <input id="textCredit" type="text" readonly name="credit" class="contact_input" value="${LOGIN_USER.credit}" />
                    <div style="float: right" >
                    <a href="javascript:openToEdit('textCredit')">Edit</a>
                    </div>

                    </div >


                    <div class="form_row">
                        <br>
                        <br>
                        <br>
                        <a href="javascript:changePassword()" >Change Password</a>
                     
                    </div>
                    <div id="changePassword" style="display:none">
                    <div class="form_row">
                    <label class="contact"><strong>Old Password:</strong></label>
                    <input type="password" name="oldpassword" id="oldPassword" class="contact_input" />
                    </div>
                        <input type="hidden" name="password" id="hiddenPassword" value="${LOGIN_USER.passwordHash}" />
                    <div class="form_row">
                    <label class="contact"><strong>New Password:</strong></label>
                    <input type="password" name="newpassword" id="newPassword" class="contact_input" />
                    </div>

                    <div class="form_row">
                    <label class="contact"><strong>Confirm Password:</strong></label>
                    <input type="password" class="contact_input" name="confirmPassword" />
                    </div>
                    </div>

                    <div class="form_row">
                        <input type="button" class="contact" value="submit" onclick="submitChangeForm()" />
                    </div>
                 </form>
                </div>
            </div>
            <div class="bottom_prod_box_big"></div>
        </div>

   </div>
                        <jsp:include page="Cart.jsp" />
                        <jsp:include page="Footer.html" />
        
        </div>
    

    <script type="text/javascript">
        if("${ErrorMsg}")
        {
        switch ("${ErrorMsg}")
         {
             case "0":
                 $("#divName").append("<label for='textName' generated='true' class='error' > User Name used enter another one </label>");
                 $("#divEmail").append("<label for='textEmail' generated='true' class='error' > Email used enter another email </label>");
                 break;
             case "1":
                 $("#divName").append("<label for='textName' generated='true' class='error' > User Name used enter another one </label>");
                 break;
             case "2":
                 $("#divEmail").append("<label for='textEmail' generated='true' class='error' > Email used enter another email </label>");
                break;
     }

     }

     function openToEdit(txt)
     {
         $("#"+txt).attr("readonly",false);
     }
     function changePassword()
     {
         $("#changePassword").css("display","block");

     }

    </script>
         
    </body>
</html>
